<?php 
function printa(&$a){
	$caller_info = debug_backtrace();
	$caller_info = array_shift($caller_info);
	$lines = file($caller_info['file']);
	$line = $lines[$caller_info['line'] - 1];
	if(preg_match('/printa\\s*\\(\$(\\w+)/', $line, $matches)) {
		$name_of_my_array = $matches[1];
	}
	$_SESSION['debug'] = $name_of_my_array.'<br />'.print_r($a, true);
}
?>
